Cancel order
To cancel, use state — a cancellation rule returned by the Order information request.
Request syntax
POST http://b2b-api.go.yandex.ru/integration/2.0/orders/cancel?order_id={order ID}
Request headers
Authorization: Bearer <OAuth-token>
OAuth access token. The steps to get a token are described in Getting started.
X-YaTaxi-Selected-Corp-Client-Id— client ID from the account. Required if multiple clients are available using the token.
Accept-Language: set language as a string (ru, en, fr, hy, he, etc.)
Request parameters
The request has one required parameter:
order_id: ID of the order to be cancelled.
Request body
Data about the cancelled order is represented in a JSON file:
| Field | Description | Format |
|---|---|---|
state |
Shows whether cancellation is currently possible. Possible values: free, paid, minimal. The value can be retrieved with the Order information request. |
String |
Response fields description
The response contains the following field:
| Field | Description | Format |
|---|---|---|
status |
Order status. | String |
Request example
POST http://b2b-api.go.yandex.ru/integration/2.0/orders/cancel?order_id=191...280
...
Authorization: Bearer <OAuth-token>
X-YaTaxi-Selected-Corp-Client-Id: <client-id>
{
"state": "free"
}
Response example
An example of a response to this request:
{
"status": "cancelled"
}
Response codes
A response to this request may contain the following HTTP codes:
200: Request completed successfully.400: Request contained an unknown parameter or a parameter with an invalid value.403:- SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header
X-YaTaxi-Selected-Corp-Client-Id(returned if more than one client is available for the token). - SELECTED_CLIENT_ACCESS_DENIED: the header
X-YaTaxi-Selected-Corp-Client-Idcontains the client's ID, which this login does not have access to.
- SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header
404: Order not found.409: Conflict occurred.
Was the article helpful?
Previous
Next